<html>
<head><meta charset="utf-8"><title>ProjectionCache · wg-traits · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/index.html">wg-traits</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/ProjectionCache.html">ProjectionCache</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="237486162"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/ProjectionCache/near/237486162" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/ProjectionCache.html#237486162">(May 05 2021 at 12:26)</a>:</h4>
<p>the projection cache does not store any info about the param env of the cached projection</p>



<a name="237486195"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/ProjectionCache/near/237486195" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/ProjectionCache.html#237486195">(May 05 2021 at 12:27)</a>:</h4>
<p>are we assuming that while we're inside of a given <code>InferCtxt</code> all <code>param_env</code>s are the same?</p>



<a name="237486339"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/ProjectionCache/near/237486339" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/ProjectionCache.html#237486339">(May 05 2021 at 12:28)</a>:</h4>
<p>I am also a bit confused about why we only store obligations containing unresolved type vars in the cache</p>



<a name="237486457"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/ProjectionCache/near/237486457" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/ProjectionCache.html#237486457">(May 05 2021 at 12:29)</a>:</h4>
<p>I guess we return these obligations the first time we check a given projection and it's not necessary to recheck them each time as they  were already added the first time?</p>



<a name="237486469"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/ProjectionCache/near/237486469" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/ProjectionCache.html#237486469">(May 05 2021 at 12:29)</a>:</h4>
<p>does that seem correct?</p>



<a name="237491440"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/ProjectionCache/near/237491440" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/ProjectionCache.html#237491440">(May 05 2021 at 13:07)</a>:</h4>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> <a href="#narrow/stream/144729-wg-traits/topic/ProjectionCache/near/237486195">said</a>:</p>
<blockquote>
<p>are we assuming that while we're inside of a given <code>InferCtxt</code> all <code>param_env</code>s are the same?</p>
</blockquote>
<p>yes</p>



<a name="237491468"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/ProjectionCache/near/237491468" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/ProjectionCache.html#237491468">(May 05 2021 at 13:07)</a>:</h4>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> <a href="#narrow/stream/144729-wg-traits/topic/ProjectionCache/near/237486339">said</a>:</p>
<blockquote>
<p>I am also a bit confused about why we only store obligations containing unresolved type vars in the cache</p>
</blockquote>
<p>yes, roughly speaking</p>



<a name="237491478"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/ProjectionCache/near/237491478" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/ProjectionCache.html#237491478">(May 05 2021 at 13:07)</a>:</h4>
<p>there were some bugs around this</p>



<a name="237492097"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/ProjectionCache/near/237492097" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/ProjectionCache.html#237492097">(May 05 2021 at 13:11)</a>:</h4>
<p>hmm, is there a reason why we can't do the same for the <code>infcx.evaluation_cache</code>?</p>



<a name="237492161"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/ProjectionCache/near/237492161" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/ProjectionCache.html#237492161">(May 05 2021 at 13:12)</a>:</h4>
<p><a href="https://doc.rust-lang.org/nightly/nightly-rustc/rustc_infer/infer/struct.InferCtxt.html#structfield.evaluation_cache">https://doc.rust-lang.org/nightly/nightly-rustc/rustc_infer/infer/struct.InferCtxt.html#structfield.evaluation_cache</a></p>



<a name="237492213"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/ProjectionCache/near/237492213" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/ProjectionCache.html#237492213">(May 05 2021 at 13:12)</a>:</h4>
<p>considering that this one is also local to our <code>InferCtxt</code> so the param envs should always be the same here</p>



<a name="237492530"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/ProjectionCache/near/237492530" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/ProjectionCache.html#237492530">(May 05 2021 at 13:14)</a>:</h4>
<p>i vaguely remember that gats can modify their param env or something, idk <span aria-label="thinking" class="emoji emoji-1f914" role="img" title="thinking">:thinking:</span></p>



<a name="237492581"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/ProjectionCache/near/237492581" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/ProjectionCache.html#237492581">(May 05 2021 at 13:14)</a>:</h4>
<p>I want to remove the assumption that param-env stays the same</p>



<a name="237492595"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/ProjectionCache/near/237492595" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/ProjectionCache.html#237492595">(May 05 2021 at 13:15)</a>:</h4>
<p>that is not a good assumption :)</p>



<a name="237492679"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/ProjectionCache/near/237492679" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/ProjectionCache.html#237492679">(May 05 2021 at 13:15)</a>:</h4>
<p>in chalk, it's not true</p>



<a name="237492687"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/ProjectionCache/near/237492687" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/ProjectionCache.html#237492687">(May 05 2021 at 13:15)</a>:</h4>
<p>it definitely seems a bit scary to me <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="237492692"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/ProjectionCache/near/237492692" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/ProjectionCache.html#237492692">(May 05 2021 at 13:15)</a>:</h4>
<p>and yes, GATs are related, though it comes up elsewhere</p>



<a name="237492709"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/ProjectionCache/near/237492709" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/ProjectionCache.html#237492709">(May 05 2021 at 13:15)</a>:</h4>
<p>it's really about HRTBs</p>



<a name="237492722"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/ProjectionCache/near/237492722" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/ProjectionCache.html#237492722">(May 05 2021 at 13:15)</a>:</h4>
<p>and it's related to some "famous" soundness bugs we hvaen't fixed yet :)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>